/*
 * @Author       : lptecodad lptecodad@sina.com
 * @Date         : 2023-03-20 09:56:03
 * @LastEditors  : lptecodad lptecodad@sina.com
 * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved. 
 */
import service from '/@/utils/request';

/**
 * （不建议写成 service.post(xxx)，因为这样 post 时，无法 params 与 data 同时传参）
 *
 */
// export const useQueryApi = (module: string, applicationm: string, code: string,) => {
//     return service({
//         url: `v0/${module}/${applicationm}/query`,
//         method: 'GET',
//         params: { code: code },
//     });
// }
// export const usePageApi = (module: string, applicationm: string, formData?: object) => {
//     return service({
//         url: `v0/${module}/${applicationm}/page`,
//         method: 'POST',
//         data: formData
//     });
// }

// export const useCreateApi = (module: string, applicationm: string, formData: object) => {
//     return service({
//         url: `v0/${module}/${applicationm}/create`,
//         method: 'POST',
//         data: formData
//     });
// }
// export const useUpdateApi = (module: string, applicationm: string, formData: object) => {
//     return service({
//         url: `v0/${module}/${applicationm}/update`,
//         method: 'PUT',
//         data: formData
//     });
// }

// export const useDeleteApi = (module: string, applicationm: string, param: string | string[]) => {
//     let arrList: string[] = []

//     if (param instanceof Array) {
//         arrList = param
//     } else {
//         arrList.push(param)
//     }

//     return service({
//         url: `v0/${module}/${applicationm}/delete`,
//         method: 'DELETE',
//         data: { codeList: arrList }
//     });
// }

// export const useTreeApi = (module: string, applicationm: string) => {
//     return service({
//         url: `v0/${module}/${applicationm}/tree`,
//         method: 'GET'
//     });
// }

export const useListApi = (module: string, applicationm: string) => {
    return service({
        url: `v0/${module}/${applicationm}/list`,
        method: 'GET'
    });
}

// export const useApi = (module: string, applicationm: string, action: string, method: string, formData: object, queryParam?: object) => {
//     return service({
//         url: `v0/${module}/${applicationm}/${action}`,
//         method: method,
//         data: formData,
//         params: queryParam
//     });
// }
